package flc.ast.adapter;

import android.graphics.Color;

import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;

import org.jetbrains.annotations.NotNull;

import flc.ast.R;
import flc.ast.bean.FormatBean;
import flc.ast.databinding.ItemVideoFormatBinding;
import stark.common.basic.adapter.BaseDBRVAdapter;

public class VideoFormatAdapter extends BaseDBRVAdapter<FormatBean, ItemVideoFormatBinding> {
    public VideoFormatAdapter() {
        super(R.layout.item_video_format, 0);
    }

    @Override
    protected void convert(@NotNull BaseDataBindingHolder<ItemVideoFormatBinding> holder, FormatBean item) {
        super.convert(holder, item);
        ItemVideoFormatBinding binding = holder.getDataBinding();
        binding.tvFormatItemName.setText(item.getName());
        if (item.isSelect()) {
            binding.llFormatItem.setBackgroundResource(R.drawable.format_sel);
            binding.tvFormatItemName.setTextColor(Color.parseColor("#FFFFFF"));
        } else {
            binding.llFormatItem.setBackgroundResource(R.drawable.format_bg);
            binding.tvFormatItemName.setTextColor(Color.parseColor("#000000"));
        }
    }
}
